import 'package:sinosheets/network/api.dart';

class LogisticsApis {
  /// 查询邮限列表
  static Future<BaseResponse> queryMailLimit() {
    return HttpClient().request(
      "/logistics/mailLimit/frontQueryMailLimit",
      HttpMethod.get,
      isShowLoading: true,
    );
  }

  /// 计算运费接口
  static Future<BaseResponse> estimateFreight(Map params) {
    params['lineSafeguardFlag'] = 1;
    return HttpClient().request(
      "/logistics/feeEstimate/estimateFreight",
      HttpMethod.post,
      parameters: params,
      isShowLoading: true,
    );
  }

  ///根据商品运费估算 /logistics/feeEstimate/estimateFreightByItems POST
  static Future<BaseResponse> estimateFreightByItems(Map params) {
    params['lineSafeguardFlag'] = 1;
    return HttpClient().request(
      "/logistics/feeEstimate/estimateFreightByItems",
      HttpMethod.post,
      parameters: params,
      isShowLoading: true,
    );
  }

  ///根据国家获取线路数量 /logistics/feeEstimate/getLineCountByCountryId GET
  static Future<BaseResponse> getLineCountByCountryId(String countryId) {
    return HttpClient().request(
      "/logistics/feeEstimate/getLineCountByCountryId",
      HttpMethod.get,
      parameters: {'countryId': countryId},
      isShowLoading: true,
    );
  }

  /// 查询寄件人配置 /logistics/configSender/queryConfigSender GET
  static Future<BaseResponse> queryConfigSender({required String storageId}) {
    return HttpClient().request(
      "/logistics/configSender/queryConfigSender",
      HttpMethod.get,
      parameters: {'storageId': storageId, 'sendType': 2},
      isShowLoading: true,
    );
  }
}
